import { _decorator, log } from 'cc';
import { DIRECTION_UNUM, ENTITY_STATE_ENUM, PARAMS_NAME_ENUM, TILE_TYPE_ENUM } from '../enums';
import { EntityManager } from '../../base/entityManager';
import { PlayerStateMachine } from './playerStateMachine';
import DataManager from '../runTime/dataManager';
const { ccclass, property } = _decorator;

@ccclass('PlayerManager')
export class PlayerManager extends EntityManager {
    
    async init() {
       super.init();

       this._fsm = this.addComponent(PlayerStateMachine);
       await this._fsm.init();
       DataManager.Instance._player = this;
       
       this.direction = DIRECTION_UNUM.RIGHT;
    //    this.state = ENTITY_STATE_ENUM.IDLE;
    }

    
}

/**
 * 当初学js的时候应该是被误导了
 * 实际上，this就是只想类本身而已，这里去理解就能解释所有了
 */
